<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<p>
			用户
			<input class="user" type="text" value="" />
		</p>
		<p>
			密码
			<input class="pas" type="password" name="" id="" value="" />
		</p>
		
		<p>
			<input type="button" id="btn" value="注册" />
		</p>
	</body>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script type="text/javascript">
		function register(data){
				$.ajax({
				type:"post",
				url:"http://120.48.109.174:8081/user/registered",
				async:true,
				data:data,
				success:function(res){
					console.log(res)
					var code = res.status;
					if(code==200){
						alert("注册成功")
					}else{
						alert("注册失败")
					}
				}
			});	
		}
		
		$("#btn").click(function(){
			var data = {
				"username":$(".user").val(),
				"password":$(".pas").val(),
			}
			register(data)
		})

		
	</script>
</html>
